//
//  DetailInfoTableViewCell.m
//  CarFace
//
//  Created by dlios on 15-3-26.
//  Copyright (c) 2015年 蓝鸥科技. All rights reserved.
//

#import "DetailInfoTableViewCell.h"

@implementation DetailInfoTableViewCell

- (void)dealloc
{
    [_nameLable release];
    [_guidePrice release];
    [_miniPrice release];
    [_info3 release];
    [super dealloc];
}




- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        
        //创建cell上的元素
        self.nameLable = [[UILabel alloc]init];
        [self.contentView addSubview:self.nameLable];
        [_nameLable release];
        
        
        self.guidePrice = [[UILabel alloc]init];
        [self.contentView addSubview:self.guidePrice];
        [_guidePrice release];
        
        self.miniPrice = [[UILabel alloc]init];
        [self.contentView addSubview:self.miniPrice];
        [_miniPrice release];
        
        
    }
    
    return self;
    
    
    
}

- (void)layoutSubviews
{
    [super layoutSubviews];
    
    //给各元素设定frame和颜色
    self.nameLable.frame = CGRectMake(5, 10, self.contentView.frame.size.width, self.contentView.frame.size.height/2-10);
//    self.nameLable.backgroundColor = [UIColor magentaColor];
    
    self.guidePrice.frame = CGRectMake(5, self.contentView.frame.size.height/2+10, self.contentView.frame.size.width/2-15, self.contentView.frame.size.height/2-15);
//    self.guidePrice.backgroundColor = [UIColor magentaColor];
    
    self.miniPrice.frame = CGRectMake(self.contentView.frame.size.width/2-10, self.contentView.frame.size.height/2+10, self.contentView.frame.size.width/2+5, self.contentView.frame.size.height/2-15);
//    self.miniPrice.backgroundColor = [UIColor magentaColor];
    
    //赋值
    self.nameLable.text = [self.info3 valueForKey:@"name"];
    self.guidePrice.text = [NSString stringWithFormat:@"指导价：%@", [self.info3 valueForKey:@"price"]];
    self.miniPrice.text = [NSString stringWithFormat:@"全国最低价：%@",[self.info3 valueForKey:@"minprice"]];
    
}



- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
